import { songListDetail } from './model/songList.d'
import { subscriber } from './model/subscriber.d'
import service from '@/utils/request'
import { Server } from 'http'
import {
  playMessage,
  playMessageRes,
  simiMusic,
  songListResponse,
  songMessageRes,
  songOfList,
} from './model/song'

export const reqRecommendSongList = () => {
  //service.get()
}

//获取歌曲详情
export const reqMusicDetail = (id: number | number[]) => {
  let params = id + ''
  if (typeof id == 'object') {
    params = id.join(',')
  }
  return service.get<any, songMessageRes>('/song/detail?ids=' + params)
}

//获取歌曲url

export const reqMusicUrl = (id: number) => {
  return service.get<any, playMessageRes>('/song/url/v1?id=' + id)
}

//歌单收藏着

export const reqSubscriber = (id: number) => {
  return service.get<any, { subscribers: subscriber[] }>(
    '/playlist/subscribers?id=' + id
  )
}

//相关歌单
export const reqRelateSongList = (id: number) => {
  return service.get<any, { playlists: songListDetail[] }>(
    '/related/playlist?id=' + id
  )
}

//包含歌曲的歌单
export const reqSimiPlayList = (id: number) => {
  return service.get<any, { playlists: songListDetail[] }>(
    '/simi/playlist?id=' + id
  )
}

//相似歌曲

export const reqSimiMusic = (id: number) => {
  return service.get<any, { songs: simiMusic[] }>('/simi/song?id=' + id)
}
